package cn.com.self.apis.controller;


import cn.com.self.apis.portal.entity.UDisputeEntity;
import cn.com.self.apis.portal.mapper.DisputeMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author1 ssh
 * @author2
 * @date 2021-04-28
 */
@Controller
@Api(tags = "个人中心-我的工单")
public class PersonalMyWorkController {

    @Autowired
    private DisputeMapper disputeMapper;

    @GetMapping(value = {"/my/requirements/id/{memberId}"})
    @ApiOperation(value = "根据用户id获取工单")
    public ResponseEntity getRequirementsByRequirementsId(@PathVariable("memberId") String memberId) {
        Map<String, Object> map = new HashMap(1);
        map.put("member_id", memberId);
        List<UDisputeEntity> uDisputeEntities = disputeMapper.selectByMap(map);
        return ResponseEntity.status(HttpStatus.OK).body(new cn.com.self.apis.core.vo.ResultModel<>(uDisputeEntities));
    }

}

